package core;

/**
 *
 * @author Ciaran Liedeman
 * @author Dirk Terblanche
 * @version 0.2
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        int port = 0;

        if (args.length == 0) {
            port = 3000;
        } else if (args.length == 1) {
            try {
                port = Integer.parseInt(args[0]);
            } catch (NumberFormatException ex) {
                System.err.println("Error: cmd port argument \"" + args[0] + "\" not integer");
                System.exit(1);
            }
        } else {
            System.out.println("Error Incorrect Invocation, use");
            System.out.println("Server [port]");
        }

        new Server(port);
    }
}
